package com.wangl.generator.wlmybatisgenerator.action;

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.wangl.generator.wlmybatisgenerator.data.DataStore;
import com.wangl.generator.wlmybatisgenerator.ui.MybatisGeneratorDialog;
import org.jetbrains.annotations.NotNull;

import java.awt.*;
import java.io.File;

/**
 * @ClassName MybatisGeneratorAction
 * @Description TODO
 * @Author wangl
 * @Date 2021/11/25 16:14
 */
public class MybatisGeneratorAction extends AnAction {
    @Override
    public void actionPerformed(@NotNull AnActionEvent e) {
        DataStore.project = e.getProject();
        DataStore.mainPath = DataStore.project.getBasePath() + File.separator + "src" + File.separator + "main";

        MybatisGeneratorDialog dialog = new MybatisGeneratorDialog();
        dialog.setLocation(600,300);
        dialog.setTitle("Mybatis generator");
        dialog.pack();
        dialog.setVisible(true);
    }
}
